#ifndef ECG_H
#define ECG_H

#include <QObject>
#include <QVector>

// change in x of derivative
const int range = 10;
// threshold for finding beginnings
const double threshold = 20000.0;

class ECG : public QObject
{
public:
    ECG();

    // add point (x, y)
    void addPoint(double x, double y);
    // return address of vector t
    QVector<double> *getX();
    // return address of vector s
    QVector<double> *getY();
    // find the derivative of the ECG signal
    QVector<double> *derivative();
    // get the derivative of the ECG signal
    QVector<double> *getDerivative();
    // find the beginnings of each ECG cycle
    QVector<int> *beginning();

private:
    // time and signal
    QVector<double> t, s;
    // derivative of the ECG signal
    QVector<double> der;
    QVector<int> beginnings;
};

#endif // ECG_H
